cmake_minimum_required(VERSION 3.10.2)
project(timewheel)
find_package(Threads)
set(CMAKE_CXX_STANDARD 17) 
add_definitions("-Wall -g")

file(GLOB_RECURSE utils_srcs  ../../base/src/*.cpp)
file(GLOB_RECURSE hub_srcs  ./src/*.cpp)
file(GLOB_RECURSE datatime_srcs ../../datetime/src/*.cpp)
file(GLOB_RECURSE logger_srcs ../../logging/src/*.cpp)
file(GLOB_RECURSE thread_srcs  ../../thread/src/*.cpp)
file(GLOB_RECURSE net_srcs  ../src/*.cpp)


# add_executable(pub pub.cpp ${hub_srcs} ${logger_srcs} ${thread_srcs} ${net_srcs} ${datatime_srcs} ${utils_srcs} )
# target_link_libraries(pub ${CMAKE_THREAD_LIBS_INIT})
# add_executable(sub sub.cpp ${hub_srcs} ${utils_srcs} ${logger_srcs}  ${thread_srcs} ${net_srcs} ${datatime_srcs})
# target_link_libraries(sub ${CMAKE_THREAD_LIBS_INIT})
# add_executable(server pubsubserver_main.cpp ${hub_srcs} ${logger_srcs} ${utils_srcs} ${thread_srcs} ${net_srcs} ${datatime_srcs})
# target_link_libraries(server ${CMAKE_THREAD_LIBS_INIT})
add_executable(serverb pubsubserver_better_main.cpp ${hub_srcs} ${logger_srcs} ${utils_srcs} ${thread_srcs} ${net_srcs} ${datatime_srcs})
target_link_libraries(serverb ${CMAKE_THREAD_LIBS_INIT})